{% set value = (value is null ? field.default : value) %}

{% if exists %}
<div class="form-field grid vertical">
    <div class="form-label">
        <label>{{ field.label|tu }}</label>
    </div>
    <div class="form-data form-uploads-wrapper">
        {% set uploadLimit = grav.config.system.media.upload_limit / 1024 / 1024 %}
        {% set dropzoneSettings = { maxFileSize: uploadLimit } %}
        <div id="grav-dropzone"
             class="dropzone"
             data-media-url="{{ base_url }}/media/{{ admin.route|trim('/') }}.json"
             data-media-local="{{ base_url_relative_frontend|rtrim('/') }}/{{ admin.route|trim('/') }}"
             data-dropzone-options="{{ dropzoneSettings|json_encode|e('html_attr') }}"></div>
        <span>{{ value|join("\n") }}</span>
    </div>
</div>
{% else %}
<div class="form-tab">
    <div class="form-field">
        <div class="form-label">
            {{ "PLUGIN_ADMIN.CANNOT_ADD_MEDIA_FILES_PAGE_NOT_SAVED"|tu }}
        </div>
    </div>
</div>
{% endif %}
